package java69.work716;

import java.util.Scanner;

public class Penguin {

    static Scanner sc = new Scanner(System.in);
    private  int health;
    private  int like;
    private  String name;
    private  String sex;
    private  String type;
    private  String str;
    static Penguin penguin = new Penguin();

    public String getSex() {
        return sex;
    }

    public void setSex(boolean sex,boolean type) {
        if (type){
            if (sex){
                this.sex ="狗仔";
            }else {
                this.sex ="狗妹";
            }
        }else {
            if (sex){
                this.sex ="Q仔";
            }else {
                this.sex ="Q妹";
            }
        }
    }

    public String getType() {
        return type;
    }

    public void setType(boolean type) {
        if (type){
            this.type = "狗狗";
        }else {
            this.type = "企鹅";
        }
    }

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        if (health<1 || health>100){
            System.out.println("健康值应该在0至100之间，默认值为60.");
            this.health = 60;
        }else {
            this.health = health;
        }
    }

    public int getLike() {
        return like;
    }

    public void setLike(int like) {
        if (like<1 || like>100){
            System.out.println("亲密值应该在0至100之间，默认值为60.");
            this.like = 60;
        }else {
            this.like = like;
        }
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Penguin() {
        this.health = 60;
        this.like = 60;
    }
    public  Penguin(int health,int like,String name,String sex,String type){
        this.sex = sex;
        this.like = like;
        this.health = health;
        this.name = name;
        this.type = type;
    }

    public boolean  choose(int i){
        if(i == 2){
            return false;
        }
        return  true;
    }
    public void sexs(){
        if (penguin.getType().equals("企鹅")){
            str="1、Q仔 2、Q妹";
        }else {
            str="1、狗仔 2、狗妹";
        }
    }

    public  void  ShowPenguin(){
        System.out.println("欢迎您来到宠物店！");
        System.out.println("请输入要领养宠物的名字：");
        penguin.setName(sc.next());
        System.out.println("请选择要领养的宠物类型：（1、狗狗 2、企鹅）！");
        boolean typ =choose(sc.nextInt());
        penguin.setType(typ);
        sexs();
        System.out.println("请选择"+penguin.getType()+"的性别：（"+str+"）");
        penguin.setSex(choose(sc.nextInt()),typ);
        System.out.println("请输入"+penguin.getType()+"的健康值！");
        penguin.setHealth(sc.nextInt());
        System.out.println("请输入"+penguin.getType()+"的亲密值！");
        penguin.setLike(sc.nextInt());
        System.out.println("宠物的自白");
        System.out.println("我的名字叫"+penguin.getName()+"，健康值是"+penguin.getHealth()+
                "，和主人亲密度是"+penguin.getLike()+"，我的性别是"+penguin.getSex()+"。");
    }

    public static void main(String[] args) {
        penguin.ShowPenguin();
    }
}
